package com.litidea.commons.dict;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.litidea.commons.keys.SystemKeys;
import com.litidea.dataobjects.KValueDO;

/**
 * 存储静态代码表
 *
 */
public class StaticDics {
	
	//通用字符替换代码
	public final static Map<Integer , String> COMMON_CHAR_CODE = new HashMap<Integer , String>(4) {
		private static final long serialVersionUID = 5526670591337720808L;
		{
			this.put(null, "-");
		}
	};
	
	//性别关系代码
	public final static Map<Integer , String> GENDER_MAP = new HashMap<Integer , String>(4) {
		private static final long serialVersionUID = 5526670591337720808L;
		{
			this.put(1, "男");this.put(2, "女");
		}
	};
	
	//判定是否的一些规格
	public final static Map<Integer , String> OK_MAP = new HashMap<Integer , String>(4) {
		private static final long serialVersionUID = 5526670591337720808L;
		{
			this.put(1, "是");this.put(2, "否");
		}
	};
	
	//部门类型列表
	public final static List<KValueDO> DEPT_TYPE_CODE_LIST = Arrays.asList(
			new KValueDO("HEAD" , "总公司"), 
			new KValueDO("BASE" , "普通部门"), 
			new KValueDO("PROD_LINE" , "产业线") , 
			new KValueDO("DEPT" , "科室")/* , 
			new KValueDO("DESIGN" , "设计院") , 
			new KValueDO("SUB_COM" , "子公司") , 
			new KValueDO("COMPANY" , "总公司")*/
	);
	
	//部门类型列表KV结构
	public final static Map<String , String> DEPT_TYPE_CODE_MAP = new HashMap<String , String>(8) {
		private static final long serialVersionUID = 5526670591337720808L;
		{
			for(KValueDO kvalueDO : DEPT_TYPE_CODE_LIST) {
				this.put(kvalueDO.getData() , kvalueDO.getLabel());
			}
		}
	};
	
	//角色类型列表
	public final static List<KValueDO> ROLE_TYPE_CODE_LIST = Arrays.asList(
			new KValueDO("DESIGN" , "设计用户") , 
			new KValueDO("TECH_INFO" , "技术资料员") , 
			new KValueDO("DEPT_U" , "船厂交接用户") , 
			new KValueDO("SHIP_U" , "船厂用户") , 
			new KValueDO("HAND_U" , "船厂科室交接用户") , 
			new KValueDO("ADMIN" , "系统管理"),
			new KValueDO("PRINT_M" , "打印管理员"),
			new KValueDO("PLAN_M" , "计划管理员"),
			new KValueDO("MAP_U" , "发图员"),
			new KValueDO("DES_U" , "销毁审核用户"),
			new KValueDO("TECH_M" , "专业技术经理"),
			new KValueDO("OTHER" , "其他普通角色")
	);
	
	//角色类型列表KV结构
	public final static Map<String , String> ROLE_TYPE_CODE_MAP = new HashMap<String , String>(8) {
		private static final long serialVersionUID = -4908915415036797801L;

		{
			for(KValueDO kvalueDO : ROLE_TYPE_CODE_LIST) {
				this.put(kvalueDO.getData() , kvalueDO.getLabel());
			}
		}
	};
	
	//动作类型
	@SuppressWarnings("serial")
	public final static Map<Integer , String> OPTION_TYPE_MAP = new HashMap<Integer , String>(4) {
		{
			this.put(SystemKeys.PUB_ADD_OPTION , "新增");
			this.put(SystemKeys.PUB_EDIT_OPTION , "编辑");
			this.put(SystemKeys.PUB_DEL_OPTION , "删除");
		}
	};
	
	//文件下载格式
	public final static Map<String , String> DOWNLOAD_FILE_CONTENT = new HashMap<String , String>(64) {
		private static final long serialVersionUID = 1L;
		{
			this.put("*" , "application/octet-stream");
			this.put(".pdf" , "application/pdf");
			this.put(".awf", "application/vnd.adobe.workflow");
			this.put(".avi", "video/avi");
			this.put(".xml", "text/xml");
			this.put(".xml", "text/xml");
			this.put(".txt", "text/plain");
			this.put(".wsdl", "text/xml");
			this.put(".png", "image/png");
			this.put(".ppt", "application/x-ppt");
			this.put(".jpg", "image/jpeg");
			this.put(".jpeg", "image/jpeg");
			this.put(".bmp", "image/bmp");
			this.put(".html", "text/html");
			this.put(".htm", "text/html");
			this.put(".doc", "application/msword");
			this.put(".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
			this.put(".xls", "application/vnd.ms-excel");
			this.put(".xlsx", "application/vnd.ms-excel");
		}
	};
	
	// 变更紧急度状态
	public final static Map<String,String> CHANGE_EMERGENCY_STATUS = new HashMap<String, String>(4){
		private static final long serialVersionUID = 1L;
		{
			this.put("1", "特急-1天");
			this.put("3", "急件-3天");
			this.put("7", "普通-7天");
			this.put("*", "其他");
		}
	};
	
	// 变更理由代码文字表
	public final static Map<String,String> CHANGE_REASON = new HashMap<String, String>(10){
		private static final long serialVersionUID = 1L;
		{
			this.put("1", "客户变更");
			this.put("2", "供应商变更");
			this.put("3", "工程变更");
			this.put("4", "质量改善");
			this.put("5", "设计变更");
			this.put("6", "资材变更");
			this.put("7", "降本要求");
			this.put("8", "安规要求");
			this.put("9", "纠错");
			this.put("10", "其他");
		}
	};
	
	// 变更申请状态
	public final static Map<String,String> CHANGE_TICKET_STATUS = new HashMap<String, String>(16){
		private static final long serialVersionUID = 1L;
		{
			// 申请提交完毕，等待科长批准
			this.put("1", "待批准");
			// 科长批准完毕, 等待验证部门领导分配验证组长
			this.put("2", "待分配");
			// 验证组长设置完毕, 等待组长判定变更类型和阶段
			this.put("3", "待设定变更类型");
			// 变更类型判定完毕, 等待组长提交评审单
			this.put("4", "待评审");
			// 组长设置完成验证规则，设置验证规则
			this.put("5", "待设置验证规则");
			this.put("6", "验证规则表待批准");
			this.put("7", "待上传验证报告");
			// 组长组织评审完各个阶段验证，转入下一环节由质量科通报客户和供应商
			this.put("8", "待通报客户和供应商");
			this.put("9", "待确认评审");
			this.put("22", "待批准下发");
			this.put("10", "待下发");
			this.put("12", "已完成");
			this.put("13", "科长已拒绝");
			// 验证规则表拒绝，退回组长
			this.put("14", "验证规则表被拒绝");
			this.put("15", "评审已拒绝");
			this.put("16", "测试报告评审阶段被拒绝");
			this.put("11", "评审确认阶段被拒绝");
			this.put("23", "部门领导拒绝下发变更");
			
			// 下发各个部门
			this.put("17", "已下发-执行中");
			/*this.put("18", "已下发-待工程部处理");
			this.put("19", "已下发-待质量部处理");
			this.put("20", "已下发-待生产班组处理");
			this.put("21", "已下发-待综合管理");*/
		}
	};
	
	// 变更申请状态
	public final static Map<String,String> EXTERNAL_CHANGE_TICKET_STATUS = new HashMap<String, String>(16){
		private static final long serialVersionUID = 1L;
		{
			// 申请提交完毕，评审部门领导分配评审人员
			this.put("1", "待组织评审人员");
			// 等待评审部门评审
			this.put("2", "待评审");
			this.put("3", "内部变更进行中");
			this.put("4", "已完成");
		}
	};
	
	// 变更验证阶段
	public final static Map<String,String> CHANGE_VERIFY_PHASE = new HashMap<String, String>(4){
		private static final long serialVersionUID = 1L;
		{
			this.put("1", "样品");
			this.put("2", "小批量");
			this.put("3", "中批量");
			this.put("4", "无需验证");
		}
	};
	
	// 风险评估-产品安全和可靠性影响
	public final static Map<String,String> IMPACT_FOR_RELIABILITY = new HashMap<String, String>(4){
		private static final long serialVersionUID = 1L;
		{
			this.put("1", "风险可控");
			this.put("2", "风险不可控");
			this.put("3", "无影响");
		}
	};
	
	// 风险评估-产品原物料处理风险
	public final static Map<String,String> IMPACT_FOR_PRODUCE_HANDLE = new HashMap<String, String>(4){
		private static final long serialVersionUID = 1L;
		{
			this.put("1", "积压报废");
			this.put("2", "降价销售");
			this.put("3", "返工再使用、销售");
			this.put("4", "无影响");
		}
	};
	
	// 评审记过
	public final static Map<Integer,String> EVALUATION_RESULT = new HashMap<Integer, String>(4){
		private static final long serialVersionUID = 1L;
		{
			this.put(1, "同意变更");
			this.put(2, "不同意变更");
		}
	};

}
